<template>
	<view class="alert-box">
		<view class="alert-text-box">
			<text class="alert-title">{{params.title}}</text>
			<text class="alert-desc">{{params.desc}}</text>
		</view>
		<view class="alert-button-box">
			<view class="submit-btn submit-btn1" @tap="buttonClick(params.buttons[0])">{{params.buttons[0]}}</view>
			<view class="submit-btn2" @tap="buttonClick(params.buttons[1])">{{params.buttons[1]}}</view>
		</view>
	</view>
</template>

<script setup>
	import { CUSTOMSERVICE_TEL } from '@/config/config.js'
	const emits = defineEmits(['close','submit'])
	defineProps({
		params:{
			type:Object,
			default:()=>{
				return {
					title:'温馨提示',
					desc:'商户身份信息已被其它帐户绑定，请使用正确的登录帐号重新登录。',
					buttons:['重新登录','联系客服']
				}
			}
		}
	})
	const buttonClick = (value)=>{
		if (value == '联系客服') {
			uni.makePhoneCall({
				phoneNumber: CUSTOMSERVICE_TEL
			})
		}
		else if (value == '取消') {
			emits('close')
		}
		else{
			emits('submit',value)
		}
	}
</script>

<style lang="scss" scoped>
	.alert-box {
		width: 520rpx;
		padding: 50rpx;
		background-color: white;
		box-sizing: border-box;
		border-radius: 20rpx;
		overflow: hidden;
		color: $xh-title-color;
		.alert-text-box{
			display: flex;
			flex-direction: column;
			align-items: center;
			.alert-title{
				font-size: 36rpx;
				font-weight: 500;
			}
			.alert-desc{
				font-size: 28rpx;
				margin-top: 40rpx;
			}
		}
		.alert-button-box{
			margin-top: 56rpx;
			.submit-btn2{
				color: $xh-color-606266;
				font-size: 28rpx;
				margin-top: 37rpx;
				text-align: center;
			}
		}
	}
</style>